package com.bw.zyk.zhanggm.stock.controller;


import com.bw.zyk.zhanggm.stock.entity.Stock;
import com.bw.zyk.zhanggm.stock.service.IStockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 库存表，代表库存，秒杀库存等信息 前端控制器
 * </p>
 *
 * @author zhanggm
 * @since 2024-04-23
 */
@RestController
@RequestMapping("/stock")
public class StockController {

    @Autowired
    IStockService iStockService;

    @GetMapping("/getListByIds")
    public List<Stock> getListByIds(@RequestParam("skuIdList") List<Long> skuIdList) {
        List<Stock> stocks = iStockService.listByIds(skuIdList);
        return stocks;
    }

}
